//
//  BEOrderDetailFooter.swift
//  BEGlobalOiler
//
//  Created by KKING on 16/9/9.
//  Copyright © 2016年 Bullseye Energy pte ltd. All rights reserved.
//

import UIKit

class BEOrderDetailConfirmFooter: UIView {
    
    var orderId: Int64 = 0
    
    class func footer()->UIView {
        return Bundle.main.loadNibNamed("BEOrderDetailConfirmFooter", owner: nil, options: nil)!.last as! UIView
    }
    
    @IBAction func confirmOrder(sender: UIButton) {
        JFProgressHUD.showloading()
        BENetworkTools.shareNetworkTool.confirmOrder(orderId: orderId) { (success, result, error) in
            
            guard let resultjson = result else {
                JFProgressHUD.showWithStatus(status: "Network fault!")
                return
            }
            if resultjson["success"] == true {
                JFProgressHUD.showSuccessWithStatus(status: "")
            } else {
                JFProgressHUD.showInfoWithStatus(status: resultjson["message"].stringValue)
            }
        }
    }
    
}
